package com.artnology.independence.model;

import java.awt.Color;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

public class DVRootPackage extends DVPackage {

	public DVRootPackage(DVGraphModel model) {
		
		super("Model Root", model);
	
	}

	@Override
	public Color getPackageColor() {
		
		return Color.WHITE;
	}

	@Override
	public boolean isTopLevelPackage() {
	
		return false;
	}

	@Override
	public int getNumberOfContainedTypesWithSubpackages() {
		
		return getGraphModel().getAllTypes().size();
	}

	@Override
	public DVPackage getParentPackage() {
		
		return null;
	}
	
	

	@Override
	public Set<DVPackage> getChildren() {
		
		return getGraphModel().getTopLevelPackages();
	}

	@Override
	public boolean isContained(DVModelObject type) {
		
		return true;
	}

	@Override
	public Color getNodeFillColor() {
	
		return Color.WHITE;
	}

	@Override
	public boolean hasNoVisibleContainedType() {
	
		return getGraphModel().getAllVisibleNodes().size() == 0;
	}




	@Override
	public Collection<DVType> getContainedTypes() {
		return getGraphModel().getAllTypes();
	}
	
	
	
	

}
